
package gov.chinatax.ctcps.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for zjzfHzgl.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="zjzfHzglForm"
 */
public class ZjzfHzglForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _sqglbh = null;
   private java.lang.String _sqdbh = null;
   private java.lang.String _sqmxbh = null;
   private java.lang.String _sx = null;

   /**
    * Standard constructor.
    */
   public ZjzfHzglForm() {
   }

   /**
    * Returns the sqglbh
    *
    * @return the sqglbh
    */
   public java.lang.String getSqglbh() {
      return _sqglbh;
   }

   /**
    * Sets the sqglbh
    *
    * @param sqglbh the new sqglbh value
    */
   public void setSqglbh(java.lang.String sqglbh) {
      _sqglbh = sqglbh;
   }
   /**
    * Returns the sqdbh
    *
    * @return the sqdbh
    */
   public java.lang.String getSqdbh() {
      return _sqdbh;
   }

   /**
    * Sets the sqdbh
    *
    * @param sqdbh the new sqdbh value
    */
   public void setSqdbh(java.lang.String sqdbh) {
      _sqdbh = sqdbh;
   }
   /**
    * Returns the sqmxbh
    *
    * @return the sqmxbh
    */
   public java.lang.String getSqmxbh() {
      return _sqmxbh;
   }

   /**
    * Sets the sqmxbh
    *
    * @param sqmxbh the new sqmxbh value
    */
   public void setSqmxbh(java.lang.String sqmxbh) {
      _sqmxbh = sqmxbh;
   }
   /**
    * Returns the sx
    *
    * @return the sx
    */
   public java.lang.String getSx() {
      return _sx;
   }

   /**
    * Sets the sx
    *
    * @param sx the new sx value
    */
   public void setSx(java.lang.String sx) {
      _sx = sx;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getSqglbh() == null) {
         errors.add("sqglbh", new ActionError("error.sqglbh.required"));
      }
      if(getSqdbh() == null) {
         errors.add("sqdbh", new ActionError("error.sqdbh.required"));
      }
      if(getSqmxbh() == null) {
         errors.add("sqmxbh", new ActionError("error.sqmxbh.required"));
      }
      // TODO test format/data
      return errors;
   }
}
